Component({
  data: {
    timbreList: [
      { 
        name: '标准女声', 
        checked: false,
        description: '清晰自然的标准女性声音',
        tags: ['标准', '清晰', '温柔']
      },
      { 
        name: '甜美童声', 
        checked: false,
        description: '活泼可爱的女童声音',
        tags: ['可爱', '活泼','童声']
      },
      { 
        name: '成熟女生', 
        checked: false,
        description: '知性而优雅的成熟女性',
        tags: ['成熟','女性','知性']
      }
    ]
  },

  methods:{
  // 单选框选中处理逻辑
  selectTimbre(e) {
    const index = e.currentTarget.dataset.index;
    const timbreList = this.data.timbreList.map((item, i) => {
      item.checked = i === index;
      return item;
    });
    this.setData({ timbreList });
  },
  selectEnter(){
    const selected = this.data.timbreList.find(item => item.checked);
    if (selected) {
      this.setData({
        selectedTimbre: {
          name: selected.name,
          description: selected.description
        }
      });
    }
    wx.showModal({
      title: '设置音色成功，音色为'+selected.name,
    })
  }
  }
});